<template>
	<view class="pages">
		<view class="form">
			<view class="form_title">{{$t('login.forget.Recover')}}</view>
			<view class="form_input">
				<view style="font-weight: bold;" @click="toCode">
					+{{code}}
					<uni-icons type="bottom" size="10" color="grey" style="margin-left: 10rpx;"></uni-icons>
				</view>
				<input type="number" :placeholder="$t('login.forget.Mobile')" v-model="form.phone">
				<uni-icons type="clear" color="grey" v-show="!!form.phone" @click="form.phone=''"></uni-icons>
			</view>
		</view>
		<view class="btn" @click="toCaptcha">{{$t('login.forget.Get')}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code: 52,
				form: {}
			};
		},
		methods: {
			toCaptcha(){
				let form = {}
				form.phone = this.form.phone
				form.phone_ex = this.code
				form.keywords = 'forget'
				uni.navigateTo({
					url: `/pages/shop/login/captcha?form=${JSON.stringify(form)}`
				})
			},
			toCode(){
				uni.navigateTo({
					url: `/pages/shop/login/code?code=${this.code}`
				})
			}
		}
	}
</script>

<style lang="scss">
	/deep/.uni-input-placeholder {
		font-size: 28rpx;
		font-weight: normal;
	}

	.form {
		width: 86%;
		margin: 100rpx auto 60rpx;

		.form_title {
			font-size: 46rpx;
		}

		.form_input {
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid #ddd;
			height: 80rpx;
			margin-top: 100rpx;

			input {
				flex-grow: 1;
				margin-left: 30rpx;
				font-weight: bold;
				font-size: 40rpx;
			}
		}
	}

	.btn {
		width: 86%;
		margin: 0 auto;
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		border-radius: 6rpx;
		background-color: #00C2C2;
		color: #fff;
	}
</style>